package com.af.monitorModule.generator.mapper;

import com.af.monitorModule.generator.entity.User;
import com.af.monitorModule.generator.entity.VO.MenuVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lyz_4dou
 * @since 2020-08-27
 */
@Component
public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT DISTINCT c.group_name, a.page_name, a.page_uri FROM page a LEFT JOIN page_role_vs b ON a.page_id = b.page_id LEFT JOIN page_group c ON a.page_group = c.group_id LEFT JOIN role d ON d.id = b.role_id LEFT JOIN role_user_vs e ON b.role_id = e.role_id WHERE e.user_id = #{id} AND d.state = 1")
    List<MenuVo> productList(Integer id);

}
